home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Amster
- **
- ** This program is free software; you can redistribute it and/or
- ** modify it under the terms of the GNU General Public License.
- **
- ** macros, structures, and prototypes
- */
-
- #include <sys/types.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <stdarg.h>
- #include <sys/time.h>
- #include <time.h>
- #include <netinet/in.h>
-
- #include "config.h"
- #include "compiler.h"
- #include "mui.h"
- #include "thread.h"
-
- #ifndef INCLUDED_AMSTER_H
- #define INCLUDED_AMSTER_H
-
- #ifndef __SASC
- /* replacement for sasc function */
- extern int stcd_i(const char *in, int *ivalue);
- #endif
-
-
- /***** Napster Protocol *****/
-
- extern char nap_host[512];
- extern char nap_server[512+6];
- extern unsigned short nap_port;
-
- extern u_long nap_sigmask;
- extern char *nap_buf;
- extern char *nap_linktype[];
-
- extern struct Library *SocketBase;
- extern struct Locale *locale;
-
-
- typedef struct song_struct {
- char *title;
- char *md5;
- u_long size;
- int bit, freq, time;
- char *user;
- u_long ip;
- int link;
- } *song, _song;
-
- typedef struct listener_struct {
- struct listener_struct *next;
- thread t;
- int ts;
-
- /* thread data */
- struct Library *DOSBase;
- struct Library *SocketBase;
- long s;
- u_long nsig, nsigm, msigm;
- struct fd_set fds;
- } *listener, _listener;
-
- #define NAPC_LOGINERROR 0
- #define NAPC_LOGIN_REQUEST 2 /* Jordan Ritter */
- #define NAPC_LOGINRESP 3
- #define NAPC_NEW_USER 6 /* Jordan Ritter */
- #define NAPC_CHECK_NAME 7 /* Jordan Ritter */
- #define NAPC_REGSUCCESS 8
- #define NAPC_REGUSED 9
- #define NAPC_NICKINVALID 10
- #define NAPC_NOTIFYSHARE 100
- #define NAPC_REMOVESHARE 102
- #define NAPC_SEARCH 200
- #define NAPC_SEARCHRESULT 201
- #define NAPC_SEARCHCOMPLETE 202
- #define NAPC_FILEINFOREQ 203
- #define NAPC_FILEINFO 204
- #define NAPC_PRIVATEMSG 205
- #define NAPC_GETERROR 206
- #define NAPC_HOTLIST_ADD 207
- #define NAPC_HOTLIST_INIT 208
- #define NAPC_USER_SIGNON 209
- #define NAPC_USER_SIGNOFF 210
- #define NAPC_BROWSEUSER 211
- #define NAPC_BROWSERESULT 212
- #define NAPC_BROWSECOMPLETE 213
- #define NAPC_FILECOUNT 214
- #define NAPC_DLINC 218
- #define NAPC_DLCOMPLETE 219
- #define NAPC_ULINC 220
- #define NAPC_ULCOMPLETE 221
- #define NAPC_HOTLIST_ACK 301
- #define NAPC_HOTLIST_ERROR 302
- #define NAPC_HOTLIST_REMOVE 303
- #define NAPC_CHANNELJOIN 400
- #define NAPC_CHANNELPART 401
- #define NAPC_PUBLICMSGSEND 402
- #define NAPC_PUBLICMSGRECV 403
- #define NAPC_GENERALERROR 404
- #define NAPC_JOINACK 405
- #define NAPC_JOINMSG 406
- #define NAPC_USERPART 407
- #define NAPC_USERLIST 408
- #define NAPC_USERLISTEND 409
- #define NAPC_CHANNELTOPIC 410
- #define NAPC_ALTDLREQ 500
- #define NAPC_ALTDLACK 501
- #define NAPC_WHOIS 603
- #define NAPC_WHOISRESP 604
- #define NAPC_WHOWASRESP 605
- #define NAPC_UPLOADREQ 607
- #define NAPC_UPLOADACCEPT 608
- #define NAPC_GETERROR2 609
- #define NAPC_LIST_CHANNELS 617
- #define NAPC_CHANNEL_ENTRY 618
- #define NAPC_LOCALQUEUEFULL 619
- #define NAPC_REMOTEQUEUEFULL 620
- #define NAPC_SYSMSG 621
- #define NAPC_GLOBALMSG 628
- #define NAPC_EMAILCHANGE 702
-
- extern void nap_login_fromlist(char *server, unsigned short port);
- extern void nap_login(void);
- extern void nap_logout(void);
- extern void nap_listen(void);
- extern void nap_send(u_int com);
- extern int nap_sendbuf(u_int com, char *buf);
- extern void nap_songfree(song s);
- extern song nap_songdup(song s);
-
- extern char *nap_strippath(char *name);
- extern char *nap_token(char **str);
- extern int nap_itoken(char **str);
- extern u_long nap_ltoken(char **str);
- extern void ListenerMsgHandler(thread t, int com, APTR data);
- THREAD_DECL(createlistener);
-
-
-
- /***** GUI Stuff *****/
-
- extern struct guidata *gui;
- extern enum OnlineState gui_onlinestate;
- extern int UseLamps; /* search.c needs this */
- extern int UseTWF; /* search.c needs this */
- extern listener l; /* Information for listener thread */
-
- enum OnlineState {
- DISCONNECTED,
- OFFLINE,
- CONNECTING,
- LOGGING_IN,
- ONLINE
- };
-
- struct guidata {
- struct MUI_CustomClass *url_mcc;
- struct MUI_CustomClass *panel_mcc;
- struct MUI_CustomClass *search_mcc;
- struct MUI_CustomClass *resultview_mcc;
- struct MUI_CustomClass *dl_mcc;
- struct MUI_CustomClass *ul_mcc;
- struct MUI_CustomClass *share_mcc;
- struct MUI_CustomClass *prf_mcc;
- struct MUI_CustomClass *about_mcc;
- struct MUI_CustomClass *info_mcc;
- struct MUI_CustomClass *msg_mcc;
- struct MUI_CustomClass *chat_mcc;
- struct MUI_CustomClass *chatline_mcc;
- struct MUI_CustomClass *navi_mcc;
- struct MUI_CustomClass *hotlist_mcc;
- struct MUI_CustomClass *channellist_mcc;
- u_long *app;
- u_long *iconpanelmenu;
- u_long *win;
- u_long *maingrp, *searchpanel, *statgrp, *stat, *lamp, *inbut, *outbut, *rebut, *rect, *iconpanel;
- u_long *swin;
- u_long *shwin;
- u_long *iwin;
- u_long *mwin;
- u_long *dwin;
- u_long *uwin;
- u_long *awin;
- u_long *WI_Navigator, *WI_ConnectTo;
- u_long *WI_Hotlist;
- u_long *WI_ChannelList;
-
- /* Connect to... */
- u_long *ST_ConnectServer, *ST_ConnectPort, *ST_ConnectUser, *ST_ConnectPw, *TG_ConnectReg;
- u_long *BT_ConnectServer;
-
- /* Stat variables */
- int Songs, Libraries, Gigabytes;
- u_long OnlineSince;
-
- /* For now, let these variables live among the GUI instance data */
- char *ConnectUser, *ConnectPw;
- };
-
- enum {
- CONNECT,
- DISCONNECT,
- RECONNECT,
- CONNECTSERVER,
- EXECUTEAREXX,
- UPDATEPANEL,
- DEICONIFIED
- };
-
-
-
- /***** Custom Class Dispatchers *****/
-
- MUI_DISPATCH_DECL(about_dispatch);
- MUI_DISPATCH_DECL(ChannelListDispatch);
- MUI_DISPATCH_DECL(chat_dispatch);
- MUI_DISPATCH_DECL(UserlistContextDispatcher);
- MUI_DISPATCH_DECL(resultview_dispatch);
- MUI_DISPATCH_DECL(ResultviewContextDispatcher);
- MUI_DISPATCH_DECL(info_dispatch);
- MUI_DISPATCH_DECL(ul_dispatch);
- MUI_DISPATCH_DECL(dl_dispatch);
- MUI_DISPATCH_DECL(msg_dispatch);
- MUI_DISPATCH_DECL(HotlistDispatch);
- MUI_DISPATCH_DECL(NavigatorDispatch);
- MUI_DISPATCH_DECL(prf_dispatch);
- MUI_DISPATCH_DECL(search_dispatch);
- MUI_DISPATCH_DECL(share_dispatch);
- MUI_DISPATCH_DECL(panel_dispatch);
-
-
-
- /***** Custom Class Methods & Attributes *****/
-
- #define DL_ADD 0x1003
- #define DL_START 0x1004
- #define DL_STARTINCOMING 0x1005
- #define DL_UPDATE 0x1010
- #define DL_CPS 0x1011
- #define DL_PLAY 0x1020
- #define DL_ABORT 0x1021
- #define DL_RESUME 0x1022
- #define DL_CLEANUP 0x1023
- #define DL_CLEANUP_SINGLE 0x1024
- #define DL_COUNTDECREMENT 0x1040
- #define DL_COUNTINCREMENT 0x1041
- #define DL_CHECKQUEUE 0x1042
- #define DL_RESUME_UPDATE 0x1049
- #define DL_INFO 0x1050
- #define DL_SETERROR 0x1051
- #define DL_RETRY 0x1052
- #define DL_POLLWAIT 0x1053
- #define DL_SETDELAY 0x1054
- #define DL_REMWAITING 0x1055
- #define DL_WATCHER 0x1056
-
- #define UPLOAD_OPEN 0x1301
- #define UPLOAD_CLOSE 0x1302
- #define UPLOAD_UPDATE 0x1303
- #define UPLOAD_CPS 0x1304
- #define UPLOAD_ADD 0x1305
- #define UPLOAD_START 0x1306
- #define UPLOAD_ABORT 0x1308
- #define UPLOAD_INFO 0x1309
- #define UPLOAD_CLEANUP 0x1310
- #define UPLOAD_CLEANUP_SINGLE 0x1311
- #define UPLOAD_WATCHER 0x1312
- #define UPLOAD_COUNTINCREMENT 0x1313
- #define UPLOAD_COUNTDECREMENT 0x1314
-
- #define NAVI_CONNECT 0x1501
- #define NAVI_GETSERVER 0x1502
- #define NAVI_ADDSERVER 0x1503
- #define NAVI_REMOVESERVER 0x1504
- #define NAVI_SAVE 0x1505
- #define NAVI_MARKSERVER 0x1506
- #define NAVI_REDRAWSERVER 0x1507
- #define NAVI_LOAD 0x1508
- #define NAVI_GETNAPIGATOR 0x1509
-
- #define CHANLIST_ENTRY 0x1801
- #define CHANLIST_UPDATE 0x1802
- #define CHANLIST_JOIN 0x1803
-
- #define HOTLIST_LOAD 0x2001
- #define HOTLIST_SAVE 0x2002
- #define HOTLIST_UPLOAD 0x2003
- #define HOTLIST_SIGNON 0x2004
- #define HOTLIST_SIGNOFF 0x2005
- #define HOTLIST_REMOVE 0x2006
- #define HOTLIST_BROWSE 0x2007
- #define HOTLIST_FOUND 0x2008
- #define HOTLIST_NICK 0x2009
- #define HOTLIST_CLEAR 0x2010
- #define HOTLIST_TOGGLE 0x2011
- #define HOTLIST_TOGGLE_RESULTS 0x2012
- #define HOTLIST_SIGNOFF_ALL 0x2013
- #define HOTLIST_ADD 0x2014
-
- #define PRF_OPEN 0x2001
- #define PRF_CANCEL 0x2002
- #define PRF_USE 0x2003
- #define PRF_SAVE 0x2004
- #define PRF_UPDATE 0x2005
- #define PRF_SAVEALL 0x2006
- #define PRF_TESTSND 0x2007
- #define PRF_ENTRY 0x2009
- #define PRF_LASTSAVED 0x2010
- #define PRF_VALIDDELAY 0x2011
-
- #define INFO_MSG 0x3001
-
- #define MSG_OPEN 0x4001
- #define MSG_GOT 0x4002
- #define MSG_SAY 0x4003
- #define MSG_WHOIS 0x4004
- #define MSG_WHOWAS 0x4005
-
- #define SEARCH_GO 0x5001
- #define SEARCH_CLEAR 0x5002
- #define SEARCH_NICK 0x5004
- #define SEARCH_FOUND 0x5005
- #define SEARCH_RESET 0x5006
- #define SEARCH_TOGGLE 0x5007
- #define SEARCH_SET 0x5009
- #define SEARCH_GET 0x5010
- #define SEARCH_USE 0x5011
- #define SEARCH_GETSTATE 0x5012
- #define SEARCH_FILLSTEM 0x5013
- #define SEARCH_DOWNLOAD 0x5014
- #define SEARCH_ADDTOHOTLIST 0x5015
- #define SEARCH_NICKFROMLIST 0x5016
-
- #define RESULTVIEW_CLEAR 0x5002
- #define RESULTVIEW_DOWNLOAD 0x5003
- #define RESULTVIEW_NICK 0x5004
- #define RESULTVIEW_FOUND 0x5005
- #define RESULTVIEW_TOGGLE_ONE 0x5008
- #define RESULTVIEW_TOGGLE_BOTH 0x5009
- #define RESULTVIEW_STAT 0x5012
- #define RESULTVIEW_INSERT 0x5013
- #define RESULTVIEW_RESETCOUNT 0x5014
- #define RESULTVIEW_STAT2 0x5015
- #define RESULTVIEW_GETSTATE 0x5016
- #define RESULTVIEW_FILLSTEM 0x5017
- #define RESULTVIEW_ADDTOHOTLIST 0x5018
- #define RESULTVIEW_NICKFROMLIST 0x5019
-
- #define PANEL_OPENDEBUG 0x6001
- #define PANEL_CLOSEDEBUG 0x6002
- #define PANEL_OPENDL 0x6003
- #define PANEL_CLOSEDL 0x6004
- #define PANEL_OPENSHARE 0x6005
- #define PANEL_CLOSESHARE 0x6006
- #define PANEL_OPENPRF 0x6007
- #define PANEL_CLOSEPRF 0x6008
- #define PANEL_OPENABOUT 0x6009
- #define PANEL_OPENMSG 0x6010
- #define PANEL_NEWCHAT 0x6012
- #define PANEL_DISPOSECHAT 0x6013
-
- #define SHARE_OPEN 0x7001
- #define SHARE_CLOSE 0x7002
- #define SHARE_ADD 0x7003
- #define SHARE_ADDDIR 0x7004
- #define SHARE_REMOVE 0x7005
- #define SHARE_LOAD 0x7006
- #define SHARE_LOADAS 0x7007
- #define SHARE_SAVE 0x7008
- #define SHARE_SAVEAS 0x7009
- #define SHARE_UPLOAD 0x7010
- #define SHARE_NOTIFYALL 0x7011
- #define SHARE_PLAY 0x7012
- #define SHARE_ADDFILE 0x7013
- #define SHARE_ADDFILEN 0x7014
- #define SHARE_SETDIR 0x7015
- #define SHARE_UPDCOUNT 0x7016
-
- #define CHAT_COMMAND 0x9001
- #define CHAT_JOINCHANNEL 0x9005
- #define CHAT_JOINACK 0x9010
- #define CHAT_PUBLICMSGRECV 0x9011
- #define CHAT_JOINMSG 0x9012
- #define CHAT_CHANNELTOPIC 0x9013
- #define CHAT_USERPART 0x9014
- #define CHAT_CHANNELPART 0x9015
- #define CHAT_USERLIST 0x9016
-
-
-
- /***** Navigator *****/
-
- struct NavigatorData {
- u_long *LV_Server, *ST_Server, *ST_Port, *ST_Comment;
- };
-
- struct ServerEntry {
- char *Name;
- unsigned short Port;
- char *Comment;
- u_long LastOnline;
- int Ping;
- u_long Giga;
- u_long Users;
- u_long Songs;
- };
-
- extern ULONG NavigatorNew(struct IClass *cl, Object *obj, struct opSet *msg);
-
- extern BOOL ServerListChanged;
-
-
-
- /***** Icon Panel *****/
-
- struct paneldata {
- u_long *logo,*infoicon,*dlicon,*shareicon,*prficon;
- };
-
-
-
- /***** Hotlist *****/
-
- struct HotlistData {
- u_long *LV_Hotlist, *LV_Search, *TG_Results, *ST_Nick;
- };
-
- struct HotlistEntry {
- char *Nick;
- int Speed;
- int Online;
- };
-
- extern ULONG HotlistNew(struct IClass *cl, Object *obj, struct opSet *msg);
- extern void HotlistInterpret(u_int com, char *data);
-
- extern BOOL HotlistChanged;
-
-
-
- /***** Channel List *****/
-
- struct ChannelListData {
- u_long *LV_Channel;
- };
-
- struct ChannelEntry {
- char *Name;
- int NumUsers;
- char *Topic;
- };
-
- extern ULONG ChannelListNew(struct IClass *cl, Object *obj, struct opSet *msg);
-
-
-
- /***** Chat Window Class *****/
-
- extern struct MUI_CustomClass *UserlistContext;
-
- typedef struct channel_struct {
- struct channel_struct *next;
- int joinflag;
- char *name;
- u_long *win;
- } *channel, _channel;
-
- struct chatdata {
- _channel chn;
- u_long *rect,*chantxt,*topicstr;
- u_long *msglist,*userlist;
- u_long *msgstr;
- };
-
- struct UserlistContextData
- {
- u_long *MI_AddToHotlist;
- u_long *MI_BrowseUser;
- };
-
- struct ChannelUserData {
- char *Name;
- int Shares;
- int Link;
- char *Display; /* storage for the display hook */
- };
-
- /* Global variables */
- extern channel chat_chans;
-
- /* Global prototypes */
- extern channel chat_findchan(char *name);
-
-
-
- /***** Resultview Class ******/
-
- extern struct MUI_CustomClass *ResultviewContext;
-
- #define MUIA_Amster_ContextMenu 0x50000001
-
- extern char *gColFormat;
- extern int gContextChoice;
-
- struct resultdata {
- u_long *result, *list;
- u_long *BT_Clear, *BT_ClearAll, *BT_Resume, *BT_Download, *fptog;
- int resultview_count;
- int resultview_state;
- };
-
- struct ResultviewContextData
- {
- u_long *MI_AddToHotlist;
- u_long *MI_BrowseUser;
- };
-
- enum {
- CLEAR_MARKED,
- CLEAR_ALL
- };
-
-
-
- /***** Debug Window *****/
-
- struct infodata {
- u_long *msglist;
- };
-
-
-
- /***** Msg *****/
-
- struct msgdata {
- u_long *msglist;
- u_long *msgstr;
- };
-
- struct ChatMessage {
- char TStamp[11];
- char *Nick;
- char *Msg;
- };
-
- extern void msg_got(struct msgdata *data, char *nick, char *msg);
- extern void msg_gotwhois(char *buf);
-
-
-
- /***** Share *****/
-
- #define ARG_PATH 0
- #define ARG_MD5 1
- #define ARG_SIZE 2
- #define ARG_BITRATE 3
- #define ARG_FREQ 4
- #define ARG_TIME 5
- #define ARG_REQCOUNT 6
-
- extern BOOL sharechanged;
-
- typedef struct sharedata_struct {
- char title[256];
- char md5[33];
- unsigned long size;
- int bitrate, freq, time;
- int reqcount;
- } *sharedata, _sharedata;
-
- struct shdata {
- u_long *list, *stat;
- };
-
- /* Prototypes */
- ULONG share_new(struct IClass *cl, Object *obj, struct opSet *msg);
- MUI_LIST_DEST_DECL(sharelistdest, sharedata sd);
- MUI_LIST_DEST_DECL(sharelistdisp, sharedata sd);
- MUI_NLIST_COMP_DECL(sharelistcomp);
- MUI_APPMSG_DECL(ShareListAppMsgFunc);
-
- /* Private */
- void add_filename(struct shdata *data, char *fname);
- void add_file(struct shdata *data, song sdl, char *fname);
- void add_shares(struct shdata *data);
- void add_directory(struct shdata *data);
- void add_recursive(struct shdata *data, sharedata sd, BPTR dirlock, const char *dirname);
- void add_shareinfo(struct shdata *data, sharedata sd, BPTR lock);
- void notify_shares(struct shdata *data);
- void remove_shares(struct shdata *data, long t);
- void save_shares(struct shdata *data);
- void save_shares_as(struct shdata *data);
- void load_shares(struct shdata *data, int merge);
- void load_shares_as(struct shdata *data, int merge);
- void update_stat(struct shdata *data);
- void play_share(struct shdata *data);
- void upload_file_confirm(struct shdata *data, char *user, char *fname);
- void update_count(struct shdata *data, char *fname);
- void nap_notifyshare(sharedata sd);
- BOOL IsIn(char *string, char c);
-
- /* Public prototypes */
- extern char *strrep(char *str1, char *old_str, char *new_str);
- extern char *MakeWinPath(char *AmigaPath);
-
-
-
- /***** Common Transfer Stuff *****/
-
- struct TransferData {
- struct MUI_InputHandlerNode ihnode;
- struct MUI_InputHandlerNode waitnode;
- struct MUI_InputHandlerNode watchnode;
- u_long *list;
- u_long *info;
- u_long *BT_Resume;
- };
-
- /* Download states
- - IMPORTANT: These states MUST be in the same order as the
- catalog string array in transfer.c
- */
- enum TransferState {
- DLS_PREP,
- DLS_QUEUE,
- DLS_WAIT,
- DLS_CON,
- DLS_REQ,
- DLS_INIT,
- DLS_DOWN,
- DLS_UP,
- DLS_FIN,
- DLS_ABORT,
- DLS_ERROR
- };
-
- /* Transfer errors
- - IMPORTANT: These errors MUST be in the same order as the
- catalog string array in transfer.c
- */
- enum TransferError {
- ERROR_UNKNOWN,
- ERROR_FILEOPEN,
- ERROR_FILEREAD,
- ERROR_FILEWRITE,
- ERROR_NET,
- ERROR_LOGGEDOUT,
- ERROR_NOTFOUND,
- ERROR_INVALIDREQUEST,
- ERROR_TEASER,
- ERROR_BUSY,
- ERROR_NOTREQUESTED,
- ERROR_TIMEOUT,
- ERROR_OUTOFBOUND
- };
-
- enum NetError {
- ERROR_NET_TIMEOUT,
- ERROR_NET_REFUSED,
- ERROR_NET_RESET,
- ERROR_NET_PIPE
- };
-
- enum TransferType {
- TYPE_DOWNLOAD_IN,
- TYPE_DOWNLOAD_OUT,
- TYPE_UPLOAD_IN,
- TYPE_UPLOAD_OUT
- };
-
- typedef struct songtrans_struct {
- struct songtrans_struct *next;
- song song;
- char *mynick;
- u_long ip;
- char host[512];
- int port;
- char *fname;
- u_long size, cur, resumestart;
- enum TransferType type;
- enum TransferState state;
- enum TransferError error;
- int ErrorCode;
- int RetryCount;
- thread t;
- int ts;
- int cps, stalltick;
- u_long oldsize;
- time_t reqtime; /* Time when the request is made */
- time_t starttime, transtime, timeleft;
-
- /* thread data */
- struct Library *DOSBase;
- struct Library *SocketBase;
- long s;
- char *buffer;
- BPTR f;
- u_long nsig, nsigm, msigm;
- struct sockaddr_in sin;
- struct fd_set fds;
- struct timeval tv;
- } *songtrans, _songtrans;
-
- extern ULONG dl_setup(struct IClass *cl, Object *obj, Msg msg);
- extern ULONG dl_muicleanup(struct IClass *cl, Object *obj, Msg msg);
- extern MUI_LIST_DISP_DECL(translistdisp, songtrans sd);
- extern MUI_LIST_DEST_DECL(translistdest, songtrans sd);
- extern void CalculateCps(songtrans sd);
- extern void TransferSetError(struct TransferData *data, char *title, char *user, int error);
- extern void TransferInfo(struct TransferData *data);
- extern void TransferAbort(struct TransferData *data);
- extern void TransferCleanup(struct TransferData *data);
- extern void TransferCleanupSingle(struct TransferData *data, songtrans sd);
- extern void TransferWatcher(struct TransferData *data);
- extern void TransferHandleError(songtrans sd);
- extern BOOL InitTransferThread(thread t, songtrans sd);
- extern void ExitTransferThread(songtrans sd, int ret);
-
-
-
- /***** Upload *****/
-
- extern int ul_count;
-
- extern void ul_addq(song s);
- extern void ul_startq(char *title, char *user, u_long ip, int port, int link);
-
- /* Private */
- void ul_startq2(struct TransferData *data, char *title, char *user, u_long ip, int port);
- void ul_abort(struct TransferData *data);
- void ul_handlemsg(thread t, int com, APTR data);
- THREAD_DECL(UploadThread);
-
-
-
- /***** Download *****/
-
- extern int dl_count;
- extern int QueueCount;
-
- enum HandlerFunc {
- DLC_STATE,
- DLC_SIZE,
- DLC_ADDSHARE,
- DLC_UPDATE
- };
-
-
-
- /***** Search Area *****/
-
- extern int search_state;
-
- struct SearchArgs {
- char *String;
- int MaxResults;
- };
-
- struct searchdata {
- u_long *str, *maxstr;
- u_long *pop;
- u_long *popspeed, *popspeedval, *popbit, *popbitval, *popfreq, *popfreqval;
- u_long *LV_Search;
- };
-
-
-
- /***** Preferences *****/
-
- extern struct prefsdata *prf;
- extern struct MUI_CustomClass *QueueClass;
-
- enum Event {
- PRFE_STARTUP,
- PRFE_EXIT,
- PRFE_CONNECT,
- PRFE_DISCONNECT,
- PRFE_DLSTART,
- PRFE_DLFINISH,
- PRFE_DLERROR,
- PRFE_DLABORT,
- PRFE_ULSTART,
- PRFE_ULFINISH,
- PRFE_ULERROR,
- PRFE_ULABORT,
- PRFE_INMSG,
- PRFE_LIB_DCLICK,
- PRFE_DL_DCLICK,
- PRFE_PLAYMP3,
- PRFE_END
- };
-
- struct prefsdata {
- /* User */
- char *user;
- char *pass;
- char *dlpath;
- char *email;
- int link;
- int BypassRegistration;
- int regflag;
- /* Options */
- int clrlist;
- int fullpath;
- int autocon;
- int askfile;
- int autoadd;
- int autosave;
- int AutoCleanup;
- int NameLength;
- /* Events */
- char *scripts[PRFE_END];
- char *sounds[PRFE_END];
- /* Advanced */
- char *napvers;
- char *MetaServer, *LeafServer;
- unsigned short MetaPort, LeafPort;
- unsigned short port;
- int DownloadQueueLimit;
- int DownloadTaskPri;
- int UploadQueueLimit;
- int UploadTaskPri;
- int QueueRetries;
- int QueueDelay;
- /* Startup */
- int noiconpanel;
- int lamps;
- int ServerList;
- /* Search */
- int speedqual, speedval;
- int bitratequal, bitrateval;
- int freqqual, freqval;
- int max;
- char ColumnOrder[9];
- };
-
-
- struct prfdata {
- u_long *ST_User, *ST_Password, *ST_EMail, *TG_BypassReg, *ST_DLPath, *CY_LinkSpeed;
- u_long *TG_ClearList, *TG_AutoConnect, *TG_AskFile, *TG_AutoAdd, *TG_AutoSave, *CM_ServerList;
- u_long *CY_ServerList, *CY_AutoCleanup, *CY_Lamp, *ST_NameLength;
- u_long *LI_Event, *ST_EventScript, *ST_EventSound;
- u_long *ST_MetaServer, *ST_MetaPort, *ST_Server, *ST_LeafPort, *ST_Port, *TG_Firewall;
- u_long *SL_DownloadQueue, *SL_UploadQueue;
- u_long *SL_DownloadPri, *SL_UploadPri;
- u_long *ST_QueueRetries, *ST_QueueDelay;
- /* u_long *VersionString;*/
- int lastitem;
- };
-
- struct QueueData
- {
- char buf[21];
- };
-
- extern BOOL prf_load(char *fname);
- extern void prf_save(char *fname);
- extern void prf_setup(int argc, char *argv[]);
- extern void prf_event(enum Event no, ...);
-
- #define PRF_DEFAULT_PORT 6699
-
-
-
- /***** ARexx *****/
-
- enum RexxCommand {
- NONE,
- WHOIS,
- SEARCH
- };
-
- extern ULONG gRC;
- extern enum RexxCommand gRexxCommand;
- extern char *gSTEM;
-
- extern struct MUI_Command rexx_cmds[];
-
- extern u_long rexx_sendcommand(char *port, char *com);
- extern void rexx_execute(char *com, char *argfmt, ...);
-
-
-
- /***** Prototypes *****/
-
- extern int lamp_create(void);
- extern void lamp_dispose(void);
- extern void lamp_useinlist(u_long *list);
- extern char *lamp_getforlist(int i);
-
- extern void gui_run(u_long tcpsig);
- extern void gui_state(enum OnlineState s);
- extern void gui_stat(char *msg, ...);
- extern void gui_srvstat(int Libraries, int Songs, int Gigabytes);
- extern void localize_array(char *array[]);
- extern void gui_found(struct song_struct *s, int type);
-
- extern void gui_debug(char *msg);
- extern void gui_debugf(char *msg, ...);
-
- extern void chat_interpret(u_int com, char *data);
-
- extern void dl_addq(struct song_struct *s);
-
- extern time_t GetDateStamp(void);
-
-
-
- #endif /* INCLUDED_AMSTER_H */
-